#! /usr/bin/python

# Bird_upCountry.py

import wx

ID_DEPTH = 1

class BirdUpCountry(wx.Dialog):
    """Change or set a default country"""
    def __init__(self, parent, id, title='Default Country'):
        wx.Dialog.__init__(self, parent, id, title, size=(420, 150))
        
        # Set the fonts
        self.dtitleFont = wx.SystemSettings_GetFont(wx.SYS_SYSTEM_FONT)
        self.dtitleFont.SetPointSize(18)
        self.dlicenceFont = wx.SystemSettings_GetFont(wx.SYS_SYSTEM_FONT)
        self.dlicenceFont.SetPointSize(9)
        
        # Start working on the gui framework
        self.dpanel = wx.Panel(self, -1)
        dvbox = wx.BoxSizer(wx.VERTICAL)
        
        # First level - Title
        dhbox1 = wx.BoxSizer(wx.HORIZONTAL)        
        self.dtitle = "Blupy Bird List Uploader 0.1a"
        self.dtitle_txt = wx.StaticText(self.dpanel, -1, self.dtitle)
        self.dtitle_txt.SetFont(self.dtitleFont)
        dhbox1.Add(self.dtitle_txt, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 8)
        dvbox.Add(dhbox1, 0, wx.ALIGN_CENTER)
        
        # Breathing room
        dvbox.Add((-1, 25))        
        
        # Set the year
        dhbox2 = wx.BoxSizer(wx.HORIZONTAL)        
        self.descript = wx.StaticText(self.dpanel, -1, "Set a default country  ",  style=wx.EXPAND)
        self.descript.SetFont(self.dlicenceFont)
        self.StCountry = wx.TextCtrl(self.dpanel, -1, value='South Africa', size=(200, 30))
        dhbox2.Add(self.descript, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 8)            
        dhbox2.Add(self.StCountry, 1)
        dvbox.Add(dhbox2, 0, wx.ALIGN_CENTER)
        
        # Breathing room
        dvbox.Add((-1, 25))        
        
        #Buttons
        dhbox_buttons = wx.BoxSizer(wx.HORIZONTAL)       
        dexit_button = wx.Button(self.dpanel, -1, "Okay", size=(70, 30))
        dhbox_buttons.Add(dexit_button, 0)
        dvbox.Add(dhbox_buttons, 0, wx.ALIGN_RIGHT | wx.RIGHT, 10)        
        self.Bind(wx.EVT_BUTTON, self.OnOkay, id=dexit_button.GetId())        
        
        # Place my panel
        self.dpanel.SetSizer(dvbox)        
        
        # End of the structure part of the module
      
    def OnOkay(self, event):
        """Close dialog"""
        self.ct = self.StCountry.GetValue()
        self.Close()
        
# End module